//
//  DetaiCodeView.swift
//  ShiZhe
//
//  Created by 陈卿伟 on 16/9/19.
//  Copyright © 2016年 陈卿伟. All rights reserved.
//

import UIKit

class DetaiCodeView: UIView {
    var baseScrollView:UIScrollView!
    var textView:UITextView!
    
    override init(frame: CGRect) {
        baseScrollView = UIScrollView()
        textView = UITextView()
        super.init(frame: frame)
        self.addscrollView()
        self.addtextView()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //添加scroll
    func addscrollView(){
        baseScrollView.frame = CGRectMake(0, 0, WidthAPP, self.frame.size.height)
        baseScrollView.backgroundColor = BaseFunc.createCustomColor(238, b: 238, g: 238, a: 1)
        self.addSubview(baseScrollView)
    }
    
    //在scrollView上添加textview
    func addtextView(){
        textView.frame = CGRectMake(15*SCALEW, 0, self.frame.size.width+30*SCALEW, self.frame.size.height)
        textView.backgroundColor = UIColor.clearColor()
        textView.font = BaseFunc.getLightFont(13)
        textView.textColor = BaseFunc.createCustomColor(83, b: 104, g: 112, a: 1)
        textView.editable = false//不可编辑
        textView.selectable = true//可选择
        textView.dataDetectorTypes = UIDataDetectorTypes.Link //只有网址加链接
        baseScrollView.addSubview(textView)
    }
}
